<!--CREATE TABLE `message` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键(自增长)',
`title` varchar(255) DEFAULT NULL COMMENT '消息标题',
`message` text COMMENT '消息内容',
`type` varchar(255) DEFAULT NULL COMMENT '消息类型',
`objectId` varchar(255) DEFAULT NULL COMMENT '类型对应的对象id',
`createTime` datetime DEFAULT NULL COMMENT '创建时间',
`status` int(1) DEFAULT '0' COMMENT '状态 1 已读 0 未读',
`senderId` varchar(255) DEFAULT NULL COMMENT '发送者',
`reciveId` varchar(255) DEFAULT NULL COMMENT '接收者',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='消息表';-->
<style scoped lang="scss">
  .messageItrem {
    padding-top: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
  }

   .im-container .el-scrollbar__wrap {
    overflow-x: hidden;
  }
</style>
<template>
  <div class="im-container">
    <meHeader>系统消息</meHeader>
    <el-scrollbar style="height: 600px;overflow-x:hidden;" scroll-y>
      <div style="padding: 10px;">
        <template v-if="systemMessageList&&systemMessageList.length!=0">
          <div v-for="(item,index) in systemMessageList" class="messageItrem">
            <div class="title padding-bottom-10"> {{ item.title }}</div>
            <div class="message padding-bottom-10" style="font-size:14px;"> {{ JSON.parse(item.message).content }}</div>
            <div class="createTime small">
              {{ item.createTime }}
            </div>
          </div>
        </template>
        <div v-else><span>没有数据</span></div>
      </div>
    </el-scrollbar>
  </div>
</template>
<script>
// import {ajaxSystemMessageList} from "../../../../common/api";
import { getLoginUser } from '@/tim/';
import { jsonParseSafe } from '@/tim';
import { getCookie } from '@/tim';
import { type_src_exhibitor } from '@/tim/constact';

export default {
  data() {
    return { systemMessageList: [] }
  },
  mounted() {
    // this.ajaxSystemMessageList()
  },
  //  getLoginUser().id,
  methods: {
    async ajaxSystemMessageList() {
      const user1 = jsonParseSafe(getCookie('user'));
      const user = getLoginUser();
      var result = await ajaxSystemMessageList({
        userId: user == type_src_exhibitor ? user1.contactId : user.id,
        lang: this.g.isEn ? 'en' : 'zh'
      })
      this.systemMessageList = result.result
      console.log('this.systemMessageList ', result.result, this.systemMessageList)
    }
  }
}
</script>
